package com.atguigu.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

@Configuration
public class FileConfig {
	 /**  
     * 文件上传配置  
     * @return  
     */  
    @Bean  
    public CommonsMultipartResolver multipartResolver() {  
    	CommonsMultipartResolver mr = new CommonsMultipartResolver(); 
    	mr.setDefaultEncoding("utf-8");
    	mr.setMaxInMemorySize(4096);
    	mr.setMaxUploadSize(104857600);

    	//mr.setMaxUploadSizePerFile(maxUploadSizePerFile);
    	//mr.setPreserveFilename(preserveFilename);
    	//mr.setResolveLazily(resolveLazily);
    	//mr.setUploadTempDir(uploadTempDir);
    	//mr.setServletContext(servletContext);
        return mr;  
    }
}
